<%@ page language="java" pageEncoding="utf8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
	dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>"
			type="text/css" />
		<link rel="stylesheet"
			href="<c:url value='/scripts/themes/base/jquery.ui.all.css'/>"
			type="text/css" />


	</head>
	<body>
		<div id="headBar" class="head_content">
			<div class="finder-action" id="">
				<div class="finder-action-inner clearfix">
					<button type="button" onclick="location.href= 'sys_admin_add.do'" class="btn btn-xl-large"> 
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 24px; height: 24px; background-position: 0pt -316px;" />
							</i>添加</span> </span>
					</button>
					<button type="button"   onclick="location.reload()" class="btn">
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 22px; height: 24px; background-position: 0pt -644px;" />
							</i>刷新</span> </span>
					</button>
					<button type="button" onclick="batchDelete()" class="btn">
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 17px; height: 24px; background-position: 0pt -757px;" />
							</i>删除</span> </span>
					</button>
				</div>
			</div>

			<div class="finder-header">

				<table width="100%" cellspacing="0" cellpadding="0">
					<!----cols---->
					<col class="span-select" style="width: 24px;" />
					<col style="width: 75px;" />
					<col style="width: 110px;" />
					<col style="width: 110px;" />
					<col style="width: 110px;" />
					<col style="width: 75px;" />
					<col />

					<thead>
						<tr>
							<td>
								<input type="checkbox" id="list_ids" class="sellist" />
							</td>
							<td>
								<table width="100%" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td>
												<span class="finder-col-label">操作</span>
											</td>
										</tr>
									</tbody>
								</table>
							</td>
							<td>
								<div key="username" class="cell orderable">
									<table width="100%" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">用户名</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div key="name" class="cell orderable">
									<table width="100%" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">姓名</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div key="lastlogin" class="cell orderable">
									<table width="100%" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">&nbsp;</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div key="department" class="cell orderable">
									<table width="100%" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">部门</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								&nbsp;
							</td>
						</tr>
					</thead>
				</table>
			</div>
		</div>
		<div id="main" class="main_content">
			<div class="finder-list finder-list-normal">
				<form id="list_form" action="sys_admin_delete.do"
					method="post">


					<table cellpadding="0" cellspacing="0" width="100%" id="list_tbl">
						<!----cols---->
						<col class="span-select" style="width: 24px;" />
						<col style="width: 75px;" />
						<col style="width: 110px;" />
						<col style="width: 110px;" />
						<col style="width: 110px;" />
						<col style="width: 75px;" />
						<col />
						<!----cols---->
						<tbody>
							<c:forEach var="admin" items="${systemAdminUsers}"
								varStatus="index">
								<tr item-id="1" class="row">
									<td>
										<input type="checkbox" value="${admin.adminId }" name="systemAdminUsers[${index.index }].adminId" class="sel"/>
									</td>
									<td key="_cmd">
										<div class="cell">
											<span><img
													style="width: 15px; height: 16px; background-position: 0pt -133px;"
													class="imgbundle" src="<c:url value="/images/transparent.gif"/>" />
													<a style="margin: 0pt 2px 0pt 1px; line-height: 1.5em;"
														href="sys_admin_edit.do?adminId=${admin.adminId}">编辑</a>
											</span>
										</div>
									</td>
									<td key="username">
										<div class="cell">
											${admin.username }
										</div>
									</td>
									<td class="editable" key="name">
										<div class="cell">
											${admin.name}
										</div>
									</td>
									<td key="lastlogin">
										<div class="cell">
											&nbsp;
										</div>
									</td>
									<td class="editable" key="department">
										<div class="cell">
											${admin.department}
										</div>
									</td>
									<td>
										&nbsp;
									</td>
								</tr>
							</c:forEach>

						</tbody>
					</table>
				</form>

			</div>

		</div>
		<div id="footBar" class="foot_content">
			<div class="finder-footer" id="finder-footer-ea2899">
				<div class="finder-page clearfix">
					<div class="span-3">

					</div>
					<div class="span-auto">
						${pagerString }
					</div>
					<div class="span-auto textright">
						共
						<i>${fn:length(systemAdminUsers)}</i>条
					</div>
				</div>
			</div>

		</div>



		<script type="text/javascript"
			src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>

		<%@ include file="/jsp/admin/common/messages.jsp"%>


		<script type="text/javascript">
	var selected = 'selected';
	$("#list_ids").click(function() {

		if (this.checked) {
			$('input[type=checkbox]').attr("checked", true);

			$('#list_tbl >tbody> tr').addClass(selected);
		} else {
			$('input[type=checkbox]').attr("checked", false);
			$('#list_tbl > tbody > tr').removeClass(selected);
		}
	});

	function changeColor(obj) {
		if ($(obj).attr("checked")) {
			$(obj).parent().parent().addClass(selected);
		} else {
			$(obj).parent().parent().removeClass(selected);
		}
	}

	function batchDelete() {
		var selected = false;
		$('#list_tbl input[type=checkbox]').each(function(i, dom) {
			if ($(dom).attr("checked")) {
				selected = true;
			}
		});
		if (!selected) {
			alert('请选择要删除的数据');
			return;
		}
		if (!confirm("确定删除吗？")) {
			return;
		}
		$('#list_form').submit();
	}
</script>


	</body>


</html>

